<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$cache_dir</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Smarty 3 Manual">
<link rel="up" href="api.variables.html" title="Chapter 13. Smarty Class Variables">
<link rel="prev" href="variable.autoload.filters.html" title="$autoload_filters">
<link rel="next" href="variable.cache.id.html" title="$cache_id">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">$cache_dir</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="variable.autoload.filters.html">Prev</a> </td>
<th width="60%" align="center">Chapter 13. Smarty Class Variables</th>
<td width="20%" align="right"> <a accesskey="n" href="variable.cache.id.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="sect1" title="$cache_dir">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="variable.cache.dir"></a>$cache_dir</h2></div></div></div>
<p>
       This is the name of the directory where template caches are
       stored. By default this is
       <code class="filename">./cache</code>, meaning that
       Smarty will look for the <code class="filename">cache/</code> directory
        in the same directory  as the executing php script.
       <span class="bold"><strong>This directory must
     be writeable by the web server</strong></span>,
     <a class="link" href="installing.smarty.basic.html" title="Basic Installation">see install</a> for more info.
     </p>
<p>
     You can also use your own <a class="link" href="caching.custom.html" title="Custom Cache Implementation">custom cache implementation</a>
       to control cache files, which will ignore this setting.
       See also
       <a class="link" href="variable.use.sub.dirs.html" title="$use_sub_dirs"><em class="parameter"><code>$use_sub_dirs</code></em></a>.
      </p>
<div class="note" title="Technical Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Technical Note</h3>
<p>
        This setting must be either a relative or
        absolute path. include_path is not used for writing files.
       </p>
</div>
<div class="note" title="Technical Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Technical Note</h3>
<p>
        It is not recommended to put this directory under
        the web server document root.
       </p>
</div>
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
        As of Smarty 3.1 the attribute $cache_dir is no longer accessible directly. Use 
        <a class="link" href="api.get.cache.dir.html" title="getCacheDir()"><code class="varname">getCacheDir()</code></a> and 
        <a class="link" href="api.set.cache.dir.html" title="setCacheDir()"><code class="varname">setCacheDir()</code></a> instead.
       </p>
</div>
<p>
  See also
  <a class="link" href="api.get.cache.dir.html" title="getCacheDir()"><code class="varname">getCacheDir()</code></a>, 
  <a class="link" href="api.set.cache.dir.html" title="setCacheDir()"><code class="varname">setCacheDir()</code></a>,
  <a class="link" href="variable.caching.html" title="$caching"><em class="parameter"><code>$caching</code></em></a>,
  <a class="link" href="variable.use.sub.dirs.html" title="$use_sub_dirs"><em class="parameter"><code>$use_sub_dirs</code></em></a>,
  <a class="link" href="variable.cache.lifetime.html" title="$cache_lifetime"><em class="parameter"><code>$cache_lifetime</code></em></a>,
  <a class="link" href="variable.cache.modified.check.html" title="$cache_modified_check"><em class="parameter"><code>$cache_modified_check</code></em></a>
  and the
  <a class="link" href="caching.html" title="Chapter 15. Caching">caching section</a>.
  </p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="variable.autoload.filters.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="api.variables.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="variable.cache.id.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">$autoload_filters </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> $cache_id</td>
</tr>
</table>
</div>
</body>
</html>
